package com.dy.system.service.impl;

import java.util.List;
import com.dy.common.utils.DateUtils;
import com.dy.system.domain.AppletBanner;
import com.dy.system.mapper.AppletBannerMapper;
import com.dy.system.service.IAppletBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 小程序bannerService业务层处理
 *
 * @author ruoyi
 * @date 2022-08-19
 */
@Service
public class AppletBannerServiceImpl implements IAppletBannerService
{
    @Autowired
    private AppletBannerMapper appletBannerMapper;

    /**
     * 查询小程序banner
     *
     * @param bannerId 小程序banner主键
     * @return 小程序banner
     */
    @Override
    public AppletBanner selectAppletBannerByBannerId(Long bannerId)
    {
        return appletBannerMapper.selectAppletBannerByBannerId(bannerId);
    }

    /**
     * 查询小程序banner列表
     *
     * @param appletBanner 小程序banner
     * @return 小程序banner
     */
    @Override
    public List<AppletBanner> selectAppletBannerList(AppletBanner appletBanner)
    {
        return appletBannerMapper.selectAppletBannerList(appletBanner);
    }

    /**
     * 新增小程序banner
     *
     * @param appletBanner 小程序banner
     * @return 结果
     */
    @Override
    public int insertAppletBanner(AppletBanner appletBanner)
    {
        appletBanner.setCreateTime(DateUtils.getNowDate());
        return appletBannerMapper.insertAppletBanner(appletBanner);
    }

    /**
     * 修改小程序banner
     *
     * @param appletBanner 小程序banner
     * @return 结果
     */
    @Override
    public int updateAppletBanner(AppletBanner appletBanner)
    {
        appletBanner.setUpdateTime(DateUtils.getNowDate());
        return appletBannerMapper.updateAppletBanner(appletBanner);
    }

    /**
     * 批量删除小程序banner
     *
     * @param bannerIds 需要删除的小程序banner主键
     * @return 结果
     */
    @Override
    public int deleteAppletBannerByBannerIds(Long[] bannerIds)
    {
        return appletBannerMapper.deleteAppletBannerByBannerIds(bannerIds);
    }

    /**
     * 删除小程序banner信息
     *
     * @param bannerId 小程序banner主键
     * @return 结果
     */
    @Override
    public int deleteAppletBannerByBannerId(Long bannerId)
    {
        return appletBannerMapper.deleteAppletBannerByBannerId(bannerId);
    }
}
